package com.education.wisdom.service.impl;

import com.education.common.utils.Convert;
import com.education.wisdom.mapper.LivebroadcastMapper;
import com.education.wisdom.pojo.Livebroadcast;
import com.education.wisdom.service.ILivebroadcastService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 达人直播资源 服务层实现
 *
 * @author ruoyi
 * @date 2019-02-16
 */
@Service
public class LivebroadcastServiceImpl implements ILivebroadcastService {
    @Autowired
    private LivebroadcastMapper livebroadcastMapper;

    /**
     * 查询达人直播资源信息
     *
     * @param id 达人直播资源ID
     * @return 达人直播资源信息
     */
    @Override
    public Livebroadcast selectLivebroadcastById(Integer id) {
        return livebroadcastMapper.selectLivebroadcastById(id);
    }

    /**
     * 查询达人直播资源列表
     *
     * @param livebroadcast 达人直播资源信息
     * @return 达人直播资源集合
     */
    @Override
    public List<Livebroadcast> selectLivebroadcastList(Livebroadcast livebroadcast) {
        return livebroadcastMapper.selectLivebroadcastList(livebroadcast);
    }

    /**
     * 新增达人直播资源
     *
     * @param livebroadcast 达人直播资源信息
     * @return 结果
     */
    @Override
    public int insertLivebroadcast(Livebroadcast livebroadcast) {
        return livebroadcastMapper.insertLivebroadcast(livebroadcast);
    }

    /**
     * 修改达人直播资源
     *
     * @param livebroadcast 达人直播资源信息
     * @return 结果
     */
    @Override
    public int updateLivebroadcast(Livebroadcast livebroadcast) {
        return livebroadcastMapper.updateLivebroadcast(livebroadcast);
    }

    /**
     * 删除达人直播资源对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteLivebroadcastByIds(String ids) {
        return livebroadcastMapper.deleteLivebroadcastByIds(Convert.toStrArray(ids));
    }

//    @Override
//    public Livebroadcast selectLiveShow(Map<String, Object> map) {
//        return livebroadcastMapper.selectLiveShow(map);
//    }
//
//    @Override
//    public List<Livebroadcast> selectLiveShows() {
//        return livebroadcastMapper.selectLiveShows();
//    }

    @Override
    public List<Livebroadcast> selectShowListByType(Map<String, Object> map) {
        return livebroadcastMapper.selectShowListByType(map);
    }

//    @Override
//    public Livebroadcast selectIsTake(Map<String, Object> map) {
//        return livebroadcastMapper.selectIsTake(map);
//    }
//
//    @Override
//    public List<Livebroadcast> selectByStatus(Map<String, Object> map) {
//        return livebroadcastMapper.selectByStatus(map);
//    }

    @Override
    public List<Livebroadcast> selectByLike(String name) {
        return livebroadcastMapper.selectByLike(name);
    }

    @Override
    public List<Livebroadcast> selectLivebroadcastByCatalogLiveCatalogId(Map<String, Object> map) {
        return livebroadcastMapper.selectLivebroadcastByCatalogLiveCatalogId(map);
    }

    @Override
    public List<Livebroadcast> selectByCatalogId(Integer catalogId) {
        return livebroadcastMapper.selectByCatalogId(catalogId);
    }

    @Override
    public List<Livebroadcast> selectByUserId(String userId) {
        return livebroadcastMapper.selectByUserId(userId);
    }

}
